function getConsult() {
    $.ajax({
        type: "get",
        url: "http://localhost:8080/api/v1/index/latest",
        success: function (response) {
            if (response.code === 200) {
                const htmlStr = template('consult', response)
                $('.common_news').html(htmlStr)
            }
        }
    });
}
getConsult()

// 最新评论
function getComment() {
    $.ajax({
        type: "get",
        url: "http://localhost:8080/api/v1/index/latest_comment",
        success: function (response) {
            console.log(response);
            if (response.code === 200) {
                const htmlStr = template('comment', response)
                $('.comment_list').html(htmlStr)
            }
        }
    });
}
getComment() 